package com.gzhu.knowledgeAdmin.common.result;

/**
 * 自定义错误码
 *
 *
 */
public enum ErrorCode {

    SUCCESS(20000, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    CAPTCHA_ERROR(40102,"验证码错误"),
    USERNAMEPASSWORD_ERROR(40103,"用户名密码错误"),
    TOKEN_INVALID(40104,"token无效或已过期"),
    CATEGORY_USED(40105,"该分类已被使用"),
    HAS_CHILDREN(40106,"该分类存在子分类"),
    OLD_PWD_ERROR(40107,"原密码错误"),
    USED_ERROR(40108,"存在被引用的数据"),
    COLLECTED_ERROR(40109,"不能重复收藏"),
    NO_ROLE(40110,"未分配角色,请联系管理员"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FILE_NOT_FOUND_ERROR(40401,"文件不存在"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
